﻿@{
    ViewBag.Title = "用户管理";
    Layout = "~/Views/Shared/_LayoutInput.cshtml";
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>详情页面</title>
</head>
<link rel="stylesheet" href="~/admin/css/other/person.css" />
<body class="pear-container">
    <div class="layui-row layui-col-space10">
        <div class="layui-col-md3">
         		<div class="layui-card">
				<div class="layui-card-body" style="padding: 25px;">
					<div class="text-center layui-text">
						<div class="user-info-head" id="userInfoHead">
							<img src="../../admin/images/avatar.jpg" id="userAvatar" width="115px" height="115px" alt="">
						</div>
						<h2 style="padding-top: 20px;font-size: 20px;">就眠仪式</h2>
						<p style="padding-top: 8px;margin-top: 10px;font-size: 13.5px;">China ， 中国</p>
					</div>
				</div>
				<div style="height: 45px;border-top: 1px whitesmoke solid;text-align: center;line-height: 45px;font-size: 13.5px;">
					<span>今日事 ，今日毕</span>
				</div>
			</div>


            <div class="layui-card">
                <div class="layui-card-header">
                    其他列表
                </div>
                <div class="layui-card-body">
                    @*<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="refreshPwd"><i class="layui-icon layui-icon-refresh"></i></button>*@
                    <ul class="list" id='log'>
                    </ul>
                </div>
            </div>
        </div>
        <div class="layui-col-md9">
            <div class="layui-card">
                <div class="layui-card-header">
                    我的信息
                </div>
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                        <div class="layui-tab-content">
                            <div class="main-container">
                                   <form class="layui-form" action="">
                <div class="layui-form-item">
                    <div class="layui-form-item layui-inline">
                        <label class="layui-form-label">用户编号</label>
                        <div class="layui-input-inline">
                            <input type="text" name="userNumber" placeholder="" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item layui-inline">
                        <label class="layui-form-label">用户昵称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="name" placeholder="" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item layui-inline">
                        <label class="layui-form-label">微信号</label>
                        <div class="layui-input-inline">
                            <input type="text" name="weChatAccount" placeholder="" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item layui-inline">
                        <label class="layui-form-label">性别</label>
                        <div class="layui-input-inline">
                            <select name="sex" lay-verify="">
                                <option value="2">请选择</option>
                                <option value="0">男</option>
                                <option value="1">女</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item layui-inline">
                        <label class="layui-form-label">用户状态</label>
                        <div class="layui-input-inline">
                            <select name="enabled" lay-verify="">
                                <option value="">请选择</option>
                                <option value="1">正常</option>
                                <option value="0">封禁</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item layui-inline">
                        <label class="layui-form-label">请求时间</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="beginCTime" id="beginTime" placeholder="yyyy-MM-dd HH:mm:ss">
                        </div>
                    </div>
                    <div class="layui-form-item layui-inline">
                        <label class="layui-form-label">结束时间</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="endCTime" id="beginTime" placeholder="yyyy-MM-dd HH:mm:ss">
                        </div>
                    </div>
                    <div class="layui-form-item layui-inline">
                       <button class="layui-btn" lay-submit="" lay-filter="formDemo">立即提交</button>
                    </div>
                </div>
            </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        layui.use(['jquery', 'element', 'layer', 'convert','button','form'], function () {
            var element = layui.element,
                layer = layui.layer,
                $ = layui.jquery,
                convert = layui.convert,
                button = layui.button,
                 form = layui.form,
                 popup = layui.popup;

                   form.on('submit(formDemo)', function(data) {
                $.ajax({
                    url: 'Update',
                    data: JSON.stringify(data.field),
                    dataType: 'json',
                    contentType: 'application/json',
                    type: 'post',
                    success: function(result) {
                         if (result.Code == 200) {
                             layer.msg(result.Msg, {
                                icon: 1,
                                time: 1000
                            }, function() {
                               location.reload();
                            });

                    }
                    else
                    {
                        layer.msg(result.Msg, {
                                icon: 2,
                                time: 1000
                            });
                    }
                    }
                })
                return false;
            });

                $("[load]").click(function() {
                    button.load({
                        elem: '[load]',
                        time: 600,
                        done: function() {
                               LoadLog();
                        }
                    })
                })

            window.callback = function (data) {
                layer.close(data.index);
                $("#userAvatar").attr("src", data.newAvatar);
            }

            $("#userAvatar").click(function () {
                layer.open({
                    type: 2,
                    title: '更换图片',
                    shade: 0.1,
                    area: ["900px", "500px"],
                    content: MODULE_PATH + 'profile.html',
                    btn: ['确定', '取消'],
                    yes: function (index, layero) {
                        window['layui-layer-iframe' + index].submitForm();
                    }
                });
            });
                  window.LoadLog = function () {

                $.ajax({
                    url: "GetUserAccessLog",
                    dataType: 'json',
                    type: 'get',
                    success: function (result) {
                        if (result.Code == 200) {
                            $("#log").html('');
                            for (var i = 0; i < result.ResData.length; i++) {
                                var str = ' <li class="list-item"><span class="title">'+result.ResData[i].ActionName+'</span><span class="footer">'+result.ResData[i].CreateTime+'</span></li>';
                                $("#log").append(str);
                            }
                        }
                    }
                });
            }
            LoadLog();
        });


    </script>
</body>
	</html>